#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>

#define PORT		9000
#define IPADDRESS	"127.0.0.90"

static void
error(char *msg)
{
	perror(msg);
	exit(1);
}

int main(int argc, char **argv)
{
	struct sockaddr_in adr_inet;	// socket address

	// establish socket
	memset(&adr_inet, 0, sizeof(adr_inet));
	adr_inet.sin_family = AF_INET;
	adr_inet.sin_port = PORT;
	if( ! inet_aton(IPADDRESS, &adr_inet.sin_addr))
		error("Bad Address");

	// use of inet_ntoa
	printf("The IP Address is %s\n", inet_ntoa(adr_inet.sin_addr));

	return 0;
}
